<template>
  <div>
    <div class="echarts-header d-flex items-c">
      <i class="iconfont icon-fangxiang1 p-all" @click="back"></i>
      <div class="echarts f-1 d-flex jc-c">问题反馈</div>
      <a class="p-all f-12" style="color:red">提交</a>
    </div>
    <div class="d-flex">
      <img src='http://h5.cmcmall.com.cn/resources/home/home-bk-2d394c6039.png@75q.webp' alt  width="80"/>
      <div>
        <p>订单反馈</p>
        <p>用户请把您的意见发表在内容当中</p>
      </div>
    </div>

    <el-form class="p-all m-all">
      <el-form-item>
      <el-rate
       v-model="value"
       @change='getValue'
    score-template="{value}"
    text-color="#909b2d"
     show-score
    allow-half
    >
</el-rate>
      </el-form-item>
      <el-form-item>
        <VueEditor v-model="body" ></VueEditor>
      </el-form-item>
      <el-form-item class="d-flex jc-c p-t m-t">
        <el-button type="primary"  @click="submit">评论</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import { VueEditor } from 'vue2-editor'
import { echartAdd } from '@/utils/api'
export default {
  data () {
    return {
      body: '',
      value: 0
    }
  },
  components: {
    VueEditor
  },
  methods: {
    back () {
      this.$router.back()
    },
    submit () {
      let obj = {
        userid: localStorage.getItem('userid'),
        username: 'aabbcc',
        kindid: 'aaaaaaaaa',
        body: this.body,
        value: this.value * 1
      }
      echartAdd(obj).then(() => {
        this.$message({
          type: 'success',
          message: '已提交反馈信息'
        })
        this.$router.push('/user')
      })
    }
  },
  mounted () {
    this.$nextTick(() => {
      let a1 = document.querySelectorAll('.ql-formats')[0]
      let a2 = document.querySelectorAll('.ql-formats')[1]
      let a3 = document.querySelectorAll('.ql-formats')[2]
      let a4 = document.querySelectorAll('.ql-formats')[3]
      let a5 = document.querySelectorAll('.ql-formats')[4]
      let a6 = document.querySelectorAll('.ql-formats')[5]
      let a7 = document.querySelectorAll('.ql-formats')[6]
      let a9 = document.querySelectorAll('.ql-formats')[8]
      document.querySelector('.ql-link').remove()
      a1.remove()
      a2.remove()
      a3.remove()
      a4.remove()
      a5.remove()
      a6.remove()
      a7.remove()
      a9.remove()
    })
  }
}
</script>

<style lang="scss" >

</style>
